// index.js
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'

Page({
  data: {
    img1: 'https://yxh-applet.oss-cn-hangzhou.aliyuncs.com/yxh/2025-04-25-22-00-22-27.png',
    img2: 'https://yxh-applet.oss-cn-hangzhou.aliyuncs.com/yxh/2025-04-25-22-00-04-34.png',
    back1url1: 'https://yxh-applet.oss-cn-hangzhou.aliyuncs.com/yxh/2025-04-25-22-00-22-27.png',
    img3: 'https://yxh-applet.oss-cn-hangzhou.aliyuncs.com/yxh/2025-04-25-22-27-13-4.png',
    img4: 'https://yxh-applet.oss-cn-hangzhou.aliyuncs.com/yxh/2025-04-25-22-25-47-10.png',
    back1url2: 'https://yxh-applet.oss-cn-hangzhou.aliyuncs.com/yxh/2025-04-25-22-00-22-27.png',
    timmer: null
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
    var that = this
    that.data.timmer = setInterval(function () {
      var back1url1 = that.data.back1url1
      back1url1 == that.data.img1 ? back1url1 = that.data.img2 : back1url1 = that.data.img1
      var back1url2 = that.data.back1url2
      back1url2 == that.data.img3 ? back1url2 = that.data.img4 : back1url2 = that.data.img3
      that.setData({
        back1url1: back1url1,
        back1url2: back1url2,
      })
    }, 2000);
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
    var that = this;
    that.clearInterval(that.data.timmer)
  },
  toorder(){
    wx.switchTab({
      url: '/pages/car/car',
    })
  },
  torechagrge(){
    wx.navigateTo({
      url: '/pages/recharge/recharge',
    })
  },
  tomine(){
    wx.switchTab({
      url: '/pages/mine/mine',
    })
  },
})